import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/vue-element-admin/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/vue-element-admin/user/logout',
    method: 'post'
  })
}

/**
 * 查询用户
 * @param data
 * @returns {AxiosPromise}
 */
export function findUser(data) {
  return request({
    url: '/user/findUser',
    method: 'post',
    data
  })
}

/**
 * 删除用户
 * @param data
 * @returns {AxiosPromise}
 */
export function deleteUser(data) {
  return request({
    url: '/user/deleteUser',
    method: 'post',
    data
  })
}

/**
 * 添加用户
 */
export function addSystemUser(data) {
  return request({
    url: '/user/addSystemUser',
    method: 'post',
    data
  })
}

/**
 * 编辑用户
 */
export function editSystemUser(data) {
  return request({
    url: '/user/upadteSystemUser',
    method: 'post',
    data
  })
}

